import express, { Request, Response, NextFunction } from 'express';
import bodyParser from 'body-parser';
import cookieSession from 'cookie-session';
import './controller';
import router from './router';

const app = express();

app.use(cookieSession({
    name: 'session',
    keys: ['ts-reader-crawllere'],
    maxAge: 24 * 60 * 60 * 1000
}));

app.use(bodyParser.urlencoded({ extended: false }));

app.use(router);

app.listen('3000', () => {
    console.log(`the sever running at http://localhost:3000`);
})